package tankgame01;

import java.util.Vector;

public class MyTank extends Tank {
    Vector<BulletShot> bulletShots = new Vector<>();
    public BulletShot bulletShot = null;

    public MyTank(int x, int y) {
        super(x, y);
        super.setSpeed(7);
    }

    @Override
    public void moveUp() {
        super.moveUp();
    }

    @Override
    public void moveDown() {
        super.moveDown();
    }

    @Override
    public void moveRight() {
        super.moveRight();
    }

    @Override
    public void moveLeft() {
        super.moveLeft();
    }

    public void shot() {
//        switch (getDirection()) {
//            case 0:
//                bulletShot = new BulletShot(getX() + 17, getY(), 0);
//                break;
//            case 1:
//                bulletShot = new BulletShot(getX() + 60, getY() + 17, 1);
//                break;
//            case 2:
//                bulletShot = new BulletShot(getX() + 17, getY() + 60, 2);
//                break;
//            case 3:
//                bulletShot = new BulletShot(getX(), getY() + 17, 3);
//                break;
//        }
//        new Thread(bulletShot).start();
//    }
        new AePlayWave("src\\shot.wav").start();
        switch (getDirection()) {
            case 0:
                bulletShot = new BulletShot(getX() + 20, getY(), 0);
                bulletShots.add(bulletShot);
                break;
            case 1:
                bulletShot = new BulletShot(getX() + 60, getY() + 20, 1);
                bulletShots.add(bulletShot);
                break;
            case 2:
                bulletShot = new BulletShot(getX() + 20, getY() + 60, 2);
                bulletShots.add(bulletShot);
                break;
            case 3:
                bulletShot = new BulletShot(getX(), getY() + 20, 3);
                bulletShots.add(bulletShot);
                break;
        }
        new Thread(bulletShot).start();
    }
}
